package com.fbli.controller;

import com.fbli.pojo.Doctor;
import com.fbli.service.DoctorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/doctor")
public class DoctorController {
    @Autowired
    private DoctorService doctorService;
    @RequestMapping("/selectAll")
    public List<Doctor> selectAll(){
        System.out.println("111");
        return doctorService.selectAll();
    }
    @RequestMapping("/selectByDepartment")
    public List<Doctor> selectByDepartment(@RequestParam String department){
            return doctorService.selectByDepartment(department);
    }
    @RequestMapping("/selectByDoctorCategory")
    public List<Doctor> selectByDoctorCategory(@RequestParam String doctorCategory){
        System.out.println("---"+doctorCategory+"---");
        return doctorService.selectByDoctorCategory(doctorCategory);
    }

}
